<?php

class NavClass{
	
	/**
	 * 
	 * @param unknown_type $row
	 * @return string
	 */
	function getNavhtml($row){
		global $db;
		
		$navstr='';
		
		/**/
		while ($rs=$db->fetch_array($row)){
			
			
			switch ($rs['foldername']){
				case "ly":
					$navstr.='<li><a href="ly.php" title="'.$rs['name'].'">'.$rs['name'].'</a></li>';
					break;
				case "news":
					$navstr.='<li><a href="news.php?pid='.$rs['id'].'&cid=1&ps=20&isp=1" title="'.$rs['name'].'">'.$rs['name'].'</a></li>';
					break;
				case "product":
					$navstr.='<li><a href="product.php?pid='.$rs['id'].'&cid=1&ps=20&isp=1" title="'.$rs['name'].'">'.$rs['name'].'</a></li>';
					break;
				case "case":
					$navstr.='<li><a href="case.php?pid='.$rs['id'].'&cid=1&ps=20&isp=1" title="'.$rs['name'].'">'.$rs['name'].'</a></li>';
					break;
			}
			
		}
		
		return $navstr;
	}
	function getNewsMore($row){
		global $db;
		$nid=0;
		while ($rs=$db->fetch_array($row)){
			switch ($rs['foldername']){
				case "news":
					$nid=$rs['id'];
					break;break;
			}
			
			
		}
		return $nid;
	}
	function getClassId($row){
		$ids='';
		global $db;
		while ($rs=$db->fetch_array($row)){
			if($rs['foldername']=='product') $ids.=$rs['id'].',';
			if($rs['foldername']=='case') $ids.=$rs['id'].',';
		}
		return $ids;
	}
	function getProductMore($row){
		global $db;
		$nid=0;
		while ($rs=$db->fetch_array($row)){
			switch ($rs['foldername']){
				case "product":
					$nid=$rs['id'];
					break;break;
			}
				
				
		}
		return $nid;
	}
	function getCaseMore($row){
		global $db;
		$nid=0;
		while ($rs=$db->fetch_array($row)){
			switch ($rs['foldername']){
				case "case":
					$nid=$rs['id'];
					break;break;
			}
	
	
		}
		return $nid;
	}
	function getFlashHtml($row){
		global $db;
		$flashstr='';
		while ($rs=$db->fetch_array($row)) {
			$flashstr.='<li><a href="'.$rs['img_link'].'"><img src="'.$rs['img_path'].'" /></a></li>';
		}
		return $flashstr;
	}
	
}

?>